export class SpriteMemory{
    constructor(){
        this.instance = null 
        this.mem = new Array(0x100)
        // 初始化精灵RAM为全FF
        for(let i = 0;i<0x100;i++){
            this.mem[i] = 0xFF
        }
        this.localPointer = 0x00
    }

    static getInstance(){
        if(!this.instance){
            this.instance = new SpriteMemory()
            return this.instance
        }
        else{
            return this.instance
        }
    }

    load(address){
        return this.mem[address]
    }

    write(address,data){
        this.mem[address] = data
    }
}